import 'element-plus/es/components/message/style/css'
import {ElMessage} from 'element-plus'

// 安装 按需引入情况下支持$message方法
const ElementPlusMessage = {
  install: (app) => {
    let elMessage = (op) => {
      return ElMessage(op)
    }
    elMessage.success = (op) => {
      return ElMessage.success(op)
    }
    elMessage.warning = (op) => {
      return ElMessage.warning(op)
    }
    elMessage.error = (op) => {
      return ElMessage.error(op)
    }
    elMessage.info = (op) => {
      return ElMessage.info(op)
    }
    app.config.globalProperties.$message = elMessage
  }
}

export default ElementPlusMessage